package org.springblade.modules.system.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.RoleConstant;
import org.springblade.modules.system.entity.AuthClient;
import org.springblade.modules.system.service.IAuthClientService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

@RestController
@AllArgsConstructor
@RequestMapping("/blade-system/public")
@ApiIgnore
@Api(value = "公开数据", tags = "接口")
public class PublicController {
    private IAuthClientService clientService;

    /**
     * 详情
     */
    @GetMapping("/clientInfo")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入client")
    public R<AuthClient> clientInfo(AuthClient authClient) {
        AuthClient detail = clientService.getOne(Condition.getQueryWrapper(authClient));
        return R.data(detail);
    }
}
